package com.mc.lp.view.controllers;

import org.springframework.stereotype.Controller;

import com.mc.lp.view.constants.IConstants;
/*
 * @author aphanda
 * @date Sep 14, 2014
 * @time 12:54:27 AM
 */

/**
 * @author aphanda
 *
 */

@Controller
class AcademicController implements IConstants {

//	@Resource
//	AcademicRecordServiceImpl academicRecordService;
//	
//	@ResponseBody
//	@RequestMapping(value="/admin/handleRequest/studentRecord/{formRequestType}", method=RequestMethod.POST,headers="Accept=application/json")
//	public IValueObject handleRequest(@RequestBody StudentRecordVO studentRecordVO,
//			@PathVariable String formRequestType) {
//		if (formRequestType == null)
//			throw new RuntimeException("Form Handler Not Found");
//		// 0 means user required all of the items,
//		// save student record as per your need
//		// System.out.println(studentRecordVO.getStudentAcademics());
//		
//		
//		
//
//		academicRecordService.saveAcademics(studentRecordVO);
//
//		// find the request type first
//		// find the request type first
//		FormRequestType formReqeustTypeEnum = FormRequestType.valueOf(formRequestType);
//		// get the form factory instance
//		FormHandlerFactory formFactory = getAdminFormHandler();
//		// find handler w.r.t form request type
//		IFormHandler<IValueObject, IValueObject> handler = formFactory
//				.getHandler(formReqeustTypeEnum);
//		IValueObject response = null;
//		try {
//			response = handler.handleRequest(formReqeustTypeEnum, studentRecordVO);
//		} catch (Exception e) {
//			try {
//				throw e;
//			} catch (Exception e1) {
//				// TODO Auto-generated catch block
//				e1.printStackTrace();
//			}
//		}
//
//		return response;
//	}
//	
//	@ResponseBody
//	@RequestMapping(value="/admin/handleRequest/studentRecord/{formRequestType}/{id}", method=RequestMethod.GET,headers="Accept=application/json")
//	public List<AcademicRecordVO> getAcademicsRequest(@PathVariable(value="id") String id,
//			@PathVariable String formRequestType) {
//
//		int gradeId = 15;
//		int termId = 2;
//
//		List<AcademicRecordVO> voList = academicRecordService.getDetailsByEntityIdTermGrade(id,	gradeId, termId);
//		System.out.println("entered in get request for Student record");
//
//		return voList;
//	}
//	
//	public FormHandlerFactory getAdminFormHandler(){
//		return this.academicRecordService.getAdminFormHandlers();
//	}
	
}
